<?

header("Cache-control: private");
header("Content-type: text/javascript");

///// VALIDATE USER SESSION

if( !$Engine->user_session( 1 )) {

	?>

	window.location = "/";
	
	<?
} else {


///// TEMP SPLIT BETWEEN NEW & OLD CONTROL HANDLING
///// (should be removed)

	if( $Engine->request->control ) {

		?>
		
		ref	= $("<?= $Engine->request->trg ?>");
		
		<?
	
		if( file_exists ($custom = ROOT . ACCOUNT ."/custom.root/control.{$Engine->request->control}.php")) include $custom;
		
		include ENGINE_CORE ."control.room/{$Engine->request->control}.php";
	
		exit();
	
	} else {

///// END TEMP


///// BUILD COMMUNICATION SET

	include ENGINE_CORE ."control.room/control._functions.php";

	$_set	= new CN($_POST['set']);

	if($_set->wtype == "win")	$gfx = "name:'Highlight', options:{startcolor:'#ffffff', endcolor:'#f9f7f7', restorecolor:'#f9f7f7', duration:1.5}";
	if($_set->wtype == "push")	$gfx = "name:'Highlight', options:{startcolor:'#fedb4e', endcolor:'#f9f7f7', restorecolor:'#f9f7f7', duration:1}";

	?>

	ref	= <?= ($_set->wtype == "win")? "win.all['".$_set->trg."']" : "{ trg : '".$_set->trg."'}"  ?>;


	<?
} 

}